<template>
	<view class="content">
		<view class="section" v-for="(item, i) in newsList" :key="i" v-if="newsList != ''">
			<view class="sec_top">
				<view class="left">
					<text class="title">{{item.create_time}}</text>
				</view>
			</view>
			<view class="cont" v-html="item.title">
			</view>
			<view class="image">
				<image :src="it" v-for="(it,i) in item.image" :key="i" @click="proviewimgCover(i,item.image)"></image>
			</view>
		</view>
		<view class="emptya flex-column flex-c-c" v-if="newsList == ''">
			<!-- <image src="https://pd.pdaxiang.com/upload/static/index/null.png"></image> -->
			<text class="size-32 color-h">暂无数据</text>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			urls: this.$configs.urls,
			newsList:[],
			page:1
		};
	},
	onHide() {
		this.page = 1;
	},
	onShow() {
		this.getlist();
	},
	onPullDownRefresh() {
		this.page = 1;
		this.newsList = [];
		this.getlist();
	},
	onReachBottom() {
		this.page++;
		this.getlist(2);
	},
	methods:{
		//预览图片
		proviewimgCover(i,image) {
			uni.previewImage({
				current:i,
				urls: image
			});
		},
		getlist(type){
			let data = {
				page:this.page
			}
			uni.showLoading()
			this.$Request.get(this.$api.user.problemRecord,data).then(res => {
				////console.log(res,"123213");
				uni.hideLoading()
				uni.stopPullDownRefresh();
				if(type==2){
					this.newsList = this.newsList.concat(res.data.list);
				}else{
					this.newsList = res.data.list;
				}
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.content {
	min-height: 100vh;
	background: #FFFFFF;
	.section{
		margin: 0 auto;
		background: #FFFFFF;
		padding: 20rpx;
		padding-bottom: 40rpx;
		box-sizing: border-box;
		margin-bottom: 20rpx;
		border-bottom: 2rpx solid #CECECE;
		.image{
			margin-top: 50rpx;
			image{
				width: 218rpx;
				height: 154rpx;
				margin-right: 10rpx;
			}
		}
		.cont{
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #333333;
			margin-top: 22rpx;
		}
		.sec_top{
			display: flex;
			justify-content: space-between;
			.left{
				image{
					width: 24rpx;
					height: 24rpx;
				}
				.title{
					font-size: 26rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #666666;
				}
			}
			.right{
				.time{
					
				}
			}
		}
		
	}
}
</style>
